namespace Tekdev.InputValidation
{
    using System;
    using System.Collections;
    using System.Reflection;

    [Serializable]
    internal class FileTypeCollection : CollectionBase
    {
		#region Constructor
		internal FileTypeCollection()
		{
		}
		#endregion

		#region CollectionBase Methods
		internal FileType this[int index]
		{
			get { return (FileType) List[index]; }
			set { List[index] = value; }
		}

        internal int Add(FileType type)
        {
            return List.Add(type);
        }

		internal void Remove(FileType type)
		{
			List.Remove(type);
		}
		#endregion

		#region Custom Methods
        internal bool Contains(string type)
        {
            for (int i = 0; i < Count; i++)
            {
                FileType currentItem = (FileType) List[i];
                if (string.Compare(currentItem.Type, type, true) == 0)
                {
                    return true;
                }
            }
            return false;
        }
		#endregion
    }
}

